//
//  TwoViewController.swift
//  first
//
//  Created by safeu on 2017/10/3.
//  Copyright © 2017年 xuyuanyuan. All rights reserved.
//

import UIKit

class TwoViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        let b = UIButton()
        b.frame = CGRect(x: 22, y: 222, width: 360, height: 300)
        b.backgroundColor = UIColor.red
        self.view.addSubview(b)
        b.setImage(UIImage(named: "22222.jpg"), for: UIControlState.normal)
        b.setImage(UIImage(named: "11111.jpg"), for: UIControlState.highlighted)
        b.setTitle("默认", for: UIControlState.normal)
        b.setTitle("高亮", for: UIControlState.highlighted)
        b.imageEdgeInsets = UIEdgeInsets(top: 10, left: 80, bottom: 10, right: 20)
        b.titleEdgeInsets = UIEdgeInsets(top: 10, left: -444, bottom: 10, right: 0)
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
